import socket

server_addr = ('localhost', 8080)

connfd = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

connfd.connect(server_addr)

message = "time"
print('< %r [%r]' % (message, connfd.getsockname()))
connfd.send(message.encode('utf-8'))
connfd.send(b'hello world')

data = connfd.recv(1024)
print('> %r [%r]' % (str(data, encoding='utf-8'), connfd.getsockname()))
connfd.close()
